package sh.grapendaal.tsuushin.module.uno.engine.impl;

import java.io.File;

import sh.grapendaal.tsuushin.module.uno.engine.Input;
import sh.grapendaal.tsuushin.module.uno.engine.Output;
import sh.grapendaal.tsuushin.module.uno.engine.UnoEngine;
import sh.grapendaal.tsuushin.module.uno.engine.service.impl.AchievementServiceImpl;
import sh.grapendaal.tsuushin.module.uno.engine.service.impl.CardServiceImpl;
import sh.grapendaal.tsuushin.module.uno.engine.service.impl.PersistenceServiceImpl;
import sh.grapendaal.tsuushin.module.uno.engine.service.impl.PlayerServiceImpl;

public final class UnoFactory {
	private UnoFactory() {
		// Utility class
	}
	
	public static UnoEngine createUnoEngine(Input input, Output output, File dataDirectory) {
		UnoEngineImpl engine = new UnoEngineImpl();
		engine.setCardService(new CardServiceImpl());
		engine.setPlayerService(new PlayerServiceImpl());
		engine.setAchievementService(new AchievementServiceImpl(engine.getPlayerService()));
		engine.setPersistenceService(new PersistenceServiceImpl(dataDirectory));
		engine.setInput(input);
		engine.setOutput(output);
		return engine;
	}
}
